/* ************* */
/* temporary fix */
/* ************* */
/* https://github.com/umap-project/umap/pull/2046#issuecomment-2278046469 */
html[dir="rtl"] .leaflet-inplace-toolbar {
    direction: ltr;
}

html[dir="rtl"] .leaflet-inplace-toolbar>* {
    direction: rtl;
}

html[dir="rtl"] .leaflet-tooltip-pane {
    direction: ltr;
}

html[dir="rtl"] .leaflet-tooltip-pane>* {
    direction: rtl;
}

.marker-cluster div {
    /* fix cluster icon for rtl */
    margin-left: unset;
    margin-inline-start: 5px;
}

/* *********** */
/*   Generic   */
/* *********** */
.with-transition {
    transition: all var(--transition);
}

.draft {
    background: repeating-linear-gradient(-45deg,
            var(--color-darkGray),
            var(--color-darkGray) 10px,
            var(--color-darkerGray) 10px,
            var(--color-darkerGray) 20px);
}

.show-on-draft {
    display: none;
}

.draft .show-on-draft {
    display: inline-block;
}

.aplat {
    padding: var(--medium-box-padding);
    margin-bottom: var(--box-margin);
    background-color: var(--color-mediumGray);
    border: 1px solid var(--color-accent);
}

.with-toolbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

/* *********** */
/* Map details */
/* *********** */
#map {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    /*
    * Same as leaflet background, to work around screen blincking
    * between DOM is loaded and JS is read to render the map.
    */
    background-color: var(--color-veryLightGray);
}

.print-portrait,
.print-landscape {
    left: initial !important;
    right: initial !important;
    top: initial !important;
    bottom: initial !important;
    height: initial !important;
}

.print-a4.print-landscape {
    aspect-ratio: 297/210;
}

.print-a4.print-portrait {
    aspect-ratio: 210/297;
}

.print-usletter.print-landscape {
    aspect-ratio: 11/8.5;
}

.print-usletter.print-portrait {
    aspect-ratio: 8.5/11;
}

/* *********** */
/* Structure   */
/* *********** */

.umap-edit-enabled {
    --current-header-height: var(--header-height);
}

.leaflet-top {
    top: var(--current-header-height);
}

.leaflet-bottom {
    bottom: var(--current-footer-height);
}


/* *********** */
/* Controls    */
/* *********** */

.leaflet-control-zoom,
.umap-control {
    background: none no-repeat scroll center center #fff;
    border-radius: 4px;
    border: 1px solid #bbb;
}

.umap-control a:hover {
    background-color: #f4f4f4;
}

.leaflet-control-fullscreen a:hover,
.leaflet-control-fullscreen a {
    height: var(--control-size);
    width: var(--control-size);
    background-size: 36px 68px;
}

.leaflet-touch .leaflet-control-fullscreen a {
    height: var(--control-size);
    width: var(--control-size);
    background-position: 0px 0px;
}

.leaflet-touch.leaflet-fullscreen-on .leaflet-control-fullscreen a,
.leaflet-fullscreen-on .leaflet-control-fullscreen a {
    background-position: 0 -32px;
}

.leaflet-measure-control a,
.leaflet-control-locate a,
.umap-control a,
.umap-control [type="button"] {
    display: block;
    height: var(--control-size);
    width: var(--control-size);
    line-height: var(--control-size);
    margin-bottom: 0;
    background-color: white;
    min-height: initial;
    padding: 0;
}

.leaflet-measure-control a,
.leaflet-control-locate a {
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-image: url('./img/24.svg');
}

.leaflet-control.display-on-more {
    display: none;
}

.umap-control-more {
    background-image: url('./img/24-white.svg');
    background-position: -72px -402px;
    margin-bottom: 0;
}

.umap-more-controls .umap-control-more {
    background-position: -108px -402px;
}

.umap-more-controls .display-on-more {
    display: block;
}

.leaflet-control-embed [type="button"] {
    background-position: 0 -180px;
}

.leaflet-control-tilelayers [type="button"] {
    background-position: -72px 0;
}

.leaflet-control-home [type="button"] {
    background-position: -122px -82px;
}

.leaflet-control-locate a {
    background-position: 0 -108px;
}

.leaflet-control-locate.active a,
.leaflet-control-locate.requesting a {
    background-position: -72px -144px;
    box-shadow: 0 0 4px 0 black inset;
}

.leaflet-control-search [type="button"] {
    background-position: -36px -108px;
    display: block;
}

.leaflet-control-search [type="button"].loading {
    background-image: url('./img/search.gif');
}

.umap-control-text {
    border: 1px solid #666;
    border-radius: 2px;
    background-color: #666;
    color: #f8f8f8;
    text-align: center;
    font-size: 0.8em;
}

.umap-control-text [type="button"] {
    float: inline-end;
    background-color: #666;
    margin: 0;
    width: 36px;
    min-height: 23px;
    height: 23px;
}

.umap-permanent-credits-container {
    max-width: 20rem;
    margin-inline-start: 5px !important;
    margin-bottom: 5px !important;
    padding: 0.5rem;
}

.credits-container h5 {
    margin-bottom: 5px;
}

.credits-container p {
    margin-top: 5px;
}

.attribution-toggle {
    display: none;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    background-image: url('./img/16.svg');
    background-position: 0px 0px;
}

.leaflet-iconLayers-layer {
    width: 38px;
    height: 38px;
    box-shadow: none;
    border: 1px solid var(--color-veryLightGray);
    border-radius: 4px;
}

.leaflet-iconLayers-layerTitleContainer {
    display: none;
    inset-inline-start: 0;
    overflow: hidden;
    min-height: 1.5rem;
    height: 1.5rem;
}

.leaflet-iconLayers-layerTitle {
    text-align: center;
    display: inline-block;
}

.leaflet-iconLayers:hover .leaflet-iconLayers-layer {
    width: 80px;
    height: 80px;
}

.leaflet-iconLayers:hover .leaflet-iconLayers-layerTitleContainer {
    display: initial;
}

.leaflet-iconLayers-layerCell:hover .leaflet-iconLayers-layerTitleContainer {
    height: initial;
}

.leaflet-iconLayers-layerCell-plus {
    width: 80px;
    height: 80px;
    background-color: var(--background-color);
    vertical-align: middle;
    text-align: center;
    font-size: 3rem;
    display: none;
    line-height: 100%;
    border-radius: var(--border-radius);
    margin-bottom: 0;
    border: 1px solid var(--color-veryLightGray);
}

.leaflet-iconLayers-layerCell-plus:hover {
    background-color: var(--color-veryLightGray);
}

.leaflet-iconLayers:hover .leaflet-iconLayers-layerCell-plus {
    display: block;
}

.home-button {
    cursor: pointer;
    line-height: 0;
    border: 1px solid var(--color-darkBlue);
    border-radius: 50%;
    background-color: var(--background-color);
}

.home-button:hover {
    background-color: var(--color-lighterGray);
}

.umap-edit-enabled .home-button {
    display: none;
}



/* ***************** */
/*    Search panel   */
/* ***************** */
ul.photon-autocomplete {
    position: absolute;
    background-color: white;
    z-index: var(--zindex-autocomplete);
    display: none;
}

.photon-autocomplete li {
    min-height: 40px;
    line-height: 1em;
    padding-inline-start: 10px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 1em;
    border-inline-start: 4px solid var(--color-veryLightGray);
}

.photon-autocomplete li strong {
    display: block;
    margin-top: 5px;
}

.photon-autocomplete button {
    margin: 0;
}

.photon-autocomplete button[type="button"]:hover {
    background-color: var(--color-darkCyan);
}

.photon-autocomplete button:hover i {
    /* TODO deal with this in icon.css  */
    background-image: url('./img/16-white.svg');
}

.photon-autocomplete li.on {
    border-inline-start: 4px solid var(--color-darkCyan);
    cursor: pointer;
    background-color: var(--color-lightCyan);
}

.photon-autocomplete li.photon-no-result {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    line-height: 40px;
}

.photon-autocomplete .photon-feedback {
    display: block;
    text-align: end;
    font-size: 0.8em;
    padding: 3px;
    color: #999;
    border-top: 1px solid #eee;
}

.search-result-tools {
    float: inline-end;
    display: none;
}

.search-result-tools button[type="button"] {
    padding: var(--text-margin);
    background-color: var(--background-color);
}

.umap-edit-enabled .photon-autocomplete li.on .search-result-tools {
    display: flex;
    position: relative;
}



/* ***************************** */
/*    Share and download panel   */
/* ***************************** */
.downloads li {
    height: 1.7em;
    padding: 0;
    text-align: start;
    vertical-align: bottom;
}

.vspace {
    height: 32px;
}

/* *********** */
/*    Draw     */
/* *********** */
.leaflet-drawing-icon,
.leaflet-editable-drawing {
    cursor: crosshair;
}

.umap-toolbar a,
.umap-toolbar a:hover {
    height: var(--control-size);
    width: var(--control-size);
    display: none;
    margin-top: 0;
    vertical-align: top;
    border-bottom: none;
    background-color: var(--color-darkGray);
    background-repeat: no-repeat;
    background-image: url('./img/24.svg');
    background-size: auto auto;
}

.umap-toolbar {
    margin-top: 0;
}

.umap-edit-enabled .umap-toolbar a {
    display: block;
}

.leaflet-middle-icon,
.leaflet-vertex-icon {
    border-radius: 50%;
}

/* ********************************* */
/*   Third party plugin override     */
/* ********************************* */

.leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
    background-image: url('img/24.svg');
    background-position: -108px -108px;
}

.leaflet-measure-control,
.leaflet-control-edit-in-osm {
    border: 1px solid #bbb;
    border-radius: 4px;
    box-shadow: none;
    background-color: white;
}

.leaflet-measure-control a {
    background-position: 0 -72px;
}

.leaflet-control .leaflet-measure-toggle {
    display: inline-block;
    vertical-align: middle;
}

.leaflet-control-locate-location circle {
    animation: none;
}



/* ********************************* */
/*     Help Lightbox                 */
/* ********************************* */
.umap-help-button[type="button"] {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-inline-start: 2px;
    background-position: 2px -4px;
    background-repeat: no-repeat;
    background-image: url('./img/16.svg');
    background-color: transparent !important;
    vertical-align: middle;
    text-indent: -9999px;
    min-height: inherit;
    padding-top: 5px;
    border: none !important;
}

.dark .umap-help-button {
    background-image: url('./img/16-white.svg');
}

.umap-help-entry+.umap-help-entry {
    margin-top: 10px;
    border-top: 1px solid #aaa;
    padding-top: 10px;
}

.umap-getstarted button {
    width: 100%;
    margin-bottom: var(--text-margin);
}

.umap-help-links li {
    margin-bottom: var(--text-margin);
}

.umap-help {
    font-style: italic;
}

.leaflet-toolbar-tip {
    background-color: var(--color-darkGray);
}

.layer-toggle {
    background-position: -49px -31px;
}

.off .layer-toggle {
    background-position: -73px -31px;
}

.feature-delete,
.layer-delete {
    background-position: -122px -49px;
}

.feature-edit,
.layer-edit {
    background-position: -50px -49px;
}

.readonly .layer-edit,
.off .layer-edit {
    background-position: -50px -73px;
}

.readonly .layer-delete,
.off .layer-delete {
    background-position: -122px -121px;
}

.show-on-edit {
    display: none !important;
}

.umap-edit-enabled .show-on-edit {
    display: inline-block !important;
}

.umap-edit-enabled .show-on-edit.inline {
    display: inline !important;
}

.umap-edit-enabled .show-on-edit.block {
    display: block !important;
}

.umap-edit-enabled .hide-on-edit {
    display: none !important;
}

/* ********************************* */
/*   Browser panel          */
/* ********************************* */

.leaflet-inplace-toolbar a {
    background-repeat: no-repeat;
    background-image: url('./img/16.svg');
    display: inline;
    padding: 0 10px;
    cursor: pointer;
    height: 24px;
    line-height: 24px;
    vertical-align: middle;
}


/* ********************************* */
/*      Tilelayer switcher           */
/* ********************************* */

.umap-edit-tilelayers li {
    border: 1px solid rgb(116, 116, 116);
    border-radius: 4px 4px 4px 4px;
    margin-bottom: 14px;
    overflow: hidden;
    position: relative;
    width: 256px;
    cursor: pointer;
    height: 200px;
    margin-left: auto;
    margin-right: auto;
}

.umap-edit-tilelayers li div {
    background-color: rgb(116, 116, 116);
    bottom: 0;
    color: rgb(247, 246, 241);
    height: 56px;
    line-height: 56px;
    opacity: 0.9;
    padding-inline-start: 10px;
    position: absolute;
    width: 100%;
    text-align: center;
}

.umap-edit-tilelayers li:hover div:before,
.umap-edit-tilelayers .selected div:before {
    content: "✓";
    font-size: 1.3em;
    line-height: 56px;
    padding-inline-end: 7px;
    position: absolute;
    inset-inline-start: 7px;
}

.umap-edit-tilelayers li img {
    display: block;
    max-width: 100%;
}

/* ********************************* */
/*            Caption                */
/* ********************************* */
.datalayer-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-inline-end: 10px;
    border: 1px solid #000;
    background-color: transparent;
    vertical-align: middle;
}

.caption-item {
    padding: var(--text-margin);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    margin-bottom: var(--box-margin);
}

.caption-item ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.caption-item .circles-layer-legend {
    padding: var(--box-padding);
}

.circles-layer-legend li {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.circles-layer-legend li .circle {
    border-radius: 50%;
    display: inline-block;
    text-align: center;
}

.rules-caption .color-box {
    width: 24px;
    height: 24px;
    line-height: 24px;
    display: inline-block;
    margin-right: var(--text-margin);
    vertical-align: middle;
    text-align: center;
}

.rules-caption .color-box img {
    vertical-align: middle;
}

/* ************* */
/* Marker's Icon */
/* ************* */
.umap-div-icon .icon-container {
    background-color: white;
    border-radius: 4px 4px 4px 4px;
    height: 32px;
    width: 32px;
    box-shadow: 7px 10px 8px -5px black;
    opacity: 0.9;
    background-color: #2470b5;
    text-align: center;
    line-height: 32px;
}

.umap-div-icon.umap-icon-active .icon-container {
    border-radius: 5px;
    box-shadow: 7px 10px 10px -1px black;
    height: 36px;
    line-height: 36px;
    margin-inline-start: -2px;
    margin-top: -4px;
    opacity: 1.0 !important;
    width: 36px;
}

.umap-div-icon .icon-container img {
    vertical-align: middle;
    max-width: 24px !important;
    /* leaflet.css has !important, so... */
    max-height: 24px !important;
}

.umap-div-icon .icon-arrow {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2270b5;
    height: 0;
    inset-inline-start: 8px;
    position: relative;
    width: 0;
    opacity: 0.9;
}

.umap-div-icon.umap-icon-active .icon-arrow {
    opacity: 1.0 !important;
}

.umap-drop-icon .icon-arrow {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 16px solid #2270B5;
    height: 0;
    inset-inline-start: 6px;
    position: relative;
    top: -4px;
    width: 0;
}

.umap-drop-icon.umap-icon-active .icon-arrow {
    border-left-width: 12px;
    border-right-width: 12px;
    border-top-width: 18px;
    inset-inline-start: 4px;
    opacity: 1.0 !important;
}

.umap-drop-icon .icon-container {
    background-color: #2470B5;
    border-radius: 16px 16px 16px 16px;
    box-shadow: 6px 13px 8px -4px black;
    height: 32px;
    line-height: 32px;
    opacity: 0.9;
    text-align: center;
    width: 32px;
}

.umap-drop-icon.umap-icon-active .icon-container {
    box-shadow: 4px 11px 10px -2px black;
    border-radius: 18px 18px 18px 18px;
    height: 36px;
    line-height: 36px;
    margin-inline-start: -2px;
    margin-top: -6px;
    opacity: 1.0 !important;
    width: 36px;
}

.umap-drop-icon .icon-container img {
    vertical-align: middle;
    max-width: 24px !important;
    max-height: 24px !important;
}

.umap-div-icon .icon-container span,
.umap-drop-icon .icon-container span {
    vertical-align: middle;
    font-weight: bold;
}

.umap-circle-icon {
    border: 2px solid white;
    border-radius: 50%;
    height: 12px;
    width: 12px;
}

.umap-circle-icon.umap-icon-active {
    opacity: 1.0 !important;
    height: 16px;
    width: 16px;
}

.umap-large-circle-icon {
    border: 2px solid white;
    background-color: white;
    border-radius: 50%;
    height: 36px;
    width: 36px;
    box-shadow: black 0px 0px 1px;
    display: flex;
    align-content: center;
    justify-content: center;
}

.umap-large-circle-icon span {
    display: flex;
    align-items: center;
    text-align: center;
}

.umap-large-circle-icon.umap-icon-active {
    opacity: 1.0 !important;
    box-shadow: var(--block-shadow);
}

.umap-ball-icon .icon-container {
    background-color: darkblue;
    background: radial-gradient(circle at 6px 38%, white -4px, darkblue 8px) repeat scroll 0 0 transparent;
    border-radius: 8px 8px 8px 8px;
    box-shadow: 1px 21px 6px -3px black;
    height: 16px;
    opacity: 0.9;
    text-align: center;
    width: 16px;
}

.umap-ball-icon.umap-icon-active .icon-container {
    border-radius: 10px 10px 10px 10px;
    box-shadow: 1px 23px 7px -1px black;
    margin-inline-start: -2px;
    margin-top: -4px;
    height: 20px;
    opacity: 1.0 !important;
    width: 20px;
}

.umap-ball-icon .icon-arrow {
    background-color: black;
    height: 16px;
    inset-inline-start: 7px;
    opacity: 0.9;
    position: relative;
    top: -1px;
    width: 2px;
}

.umap-icon-active {
    opacity: 1.0 !important;
}

.umap-edit-enabled .readonly {
    cursor: not-allowed;
}

.umap-raw-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    overflow: hidden;
}

.umap-raw-icon img {
    object-fit: contain;
}

.umap-raw-icon.umap-icon-active {
    box-shadow: var(--block-shadow);
}

.umap-cluster-icon {
    border-radius: 50%;
    border: 4px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.leaflet-overlay-pane>svg {
    z-index: var(--zindex-orphan-marker);
}

/* ********************************* */
/*         Ajax loader               */
/* ********************************* */
.umap-loader {
    width: 100%;
    height: 6px;
    display: inline-block;
    position: absolute;
    background: var(--color-brightCyan);
    overflow: hidden;
    display: none;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: var(--zindex-loader);
}

.umap-loader::after {
    content: '';
    box-sizing: border-box;
    width: 0;
    height: 4.8px;
    background: var(--color-darkerGray);
    position: absolute;
    top: 0;
    left: 0;
    animation: animFw 10s linear infinite;
}

@keyframes animFw {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

.umap-loading .umap-loader {
    display: block;
}

/* *************************** */
/* Overriding leaflet defaults */
/* *************************** */

.leaflet-control-zoom a,
.leaflet-control-zoom a:hover {
    height: var(--control-size);
    width: var(--control-size);
    line-height: var(--control-size);
}

.leaflet-left .leaflet-control {
    margin-left: var(--panel-gutter);
    margin-top: var(--panel-gutter);
}

.leaflet-container .leaflet-control-zoom {
    margin-inline-start: var(--panel-gutter);
}

.leaflet-top,
.leaflet-bottom {
    z-index: var(--zindex-controls);
}

.leaflet-inplace-toolbar {
    z-index: var(--zindex-toolbar) !important;
}

.leaflet-inplace-toolbar a {
    background-image: url('./img/16-white.svg');
    background-color: var(--color-darkGray) !important;
}

.leaflet-inplace-toolbar a:hover {
    background-color: #353c3e !important;
}

.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
    border-width: 1px;
}

.leaflet-touch .leaflet-bar a {
    width: var(--control-size);
    height: var(--control-size);
    line-height: var(--control-size);
}

/* Links are dark cyan by default  */
.leaflet-container a {
    color: var(--color-veryDarkCyan);
}

/* But not in controls  */
.leaflet-bar a {
    color: black;
}

/* ****** */
/* Mobile */
/* ****** */

@media all and (max-width: 980px) {

    .umap-main-edit-toolbox .umap-user span,
    .leaflet-container .leaflet-control-edit-save span,
    .leaflet-container .leaflet-control-edit-disable span,
    .leaflet-container .edit-cancel span {
        display: none;
    }

    .umap-main-edit-toolbox .umap-help-button {
        display: none;
    }

    .umap-main-edit-toolbox .umap-user {
        margin-inline-end: 10px;
    }
}

@media all and (max-width: 640px) {
    .umap-main-edit-toolbox .umap-user {
        display: none;
    }

    .umap-main-edit-toolbox .map-name {
        max-width: 150px;
    }
}

@media all and (max-width: 480px) {
    .leaflet-control-layers-expanded label {
        display: inline-block;
        margin-inline-end: 10px;
    }

    .leaflet-control-layers-expanded {
        margin-inline-start: 10px;
    }

    .umap-permanent-credits-container {
        max-width: 100%;
    }

    .attribution-toggle {
        display: inline-block;
    }

    .attribution-container {
        display: none;
    }

    .leaflet-control-attribution:active .attribution-container,
    .leaflet-control-attribution:hover .attribution-container {
        display: inline;
        background-color: #fff;
    }

    .leaflet-control-attribution:hover .attribution-toggle {
        display: none;
    }


}

/* ****** */
/* Print  */
/* ****** */

@media print {

    .leaflet-control-container {
        display: none;
    }
}
